<!DOCTYPE html>
<html lang="en">
<head>
  <title></title>
  <script type="text/javascript" src="../internal.js"></script>
  <style>
    #select-list input{
      display: inline-block;
      width: 100px;
    }
  </style>
</head>
<body>
<div>
  <span>合同属性:</span>
  <select id="dateCode">
    <option value="">无</option>
    <option value="effectiveDateStart">生效开始时间</option>
    <option value="effectiveDateEnd">生效结束时间</option>
    <option value="deliveryDate">交付截止日期</option>
  </select>
  <span>日期格式</span>
  <select id="date-dateFormat">
    <!-- <option value="yyyy-MM">yyyy-MM</option>
    <option value="yyyy年MM月">yyyy年MM月</option> -->
    <option value="yyyy-MM-dd">yyyy-MM-dd</option>
    <!-- <option value="yyyy年MM月dd日">yyyy年MM月dd日</option> -->
  </select>
  <button onclick="submit()">确定</button>
</div>
</body>
<script>
  function submit(){
    var id = 'date' + Math.random().toString().slice(-10);
    var str = '<input style="width: 180px" id="' + id + '"/>';
    var code = document.getElementById('dateCode').value;
    editor.execCommand('insertHtml',str, true);
    editor.elList.push({
        elId: id,
        elType: 'date',
        elFormat: document.getElementById('date-dateFormat').value,
        elField: code
    });
    dialog.popup.hide();
  }
</script>
</html>
